package aitrade.trade;

import java.text.SimpleDateFormat;

import org.apache.log4j.Logger;

/**
 * @Description: 智能自动交易
 * @author buxinyun
 * @date 2018年6月11日
 *
 */
public class App {

	public static void main(String[] args) {

		AiTrade aiTrade = new AiTrade();
		Logger logger = Logger.getLogger(App.class);
		SimpleDateFormat sformat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");

		while (true) {
			try {
				// 每隔5秒检测K线
				String timestr = sformat.format(System.currentTimeMillis());
				logger.info("start Analysis KLine: " + timestr);

				aiTrade.doWork();
				Thread.sleep(2000);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}

}
